﻿using SimStatus.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace SimStatus
{
    /// <summary>
    /// Dashboard.xaml 的交互逻辑
    /// </summary>
    public partial class Dashboard : Window
    {
        public Dashboard()
        {
            InitializeComponent();
        }

        public MainWindow main { get; set; }

        public new IContent Content
        {
            get
            {
                if(this.root.Children.Count>0)
                {
                    return (IContent)this.root.Children[0];
                }
                else
                {
                    return null;
                }
            }
            set
            {
                this.root.Children.Clear();
                this.root.Children.Add((UIElement)value);
            }
        }

        private void report_Click(object sender, RoutedEventArgs e)
        {
            var report = new SimStatus.UI.Errors.Report();
            report.main = this.main;
            this.Content = report;
        }
    }
}
